Skip to content

A1: ETL 재적재 — ttareungi.dong_code 마포 + ecos.cycle 100%#198

Merged
bat1120 merged 1 commit into
devfrom
IM3-etl-refill-ttareungi-ecos
May 5, 2026
Merged

A1: ETL 재적재 — ttareungi.dong_code 마포 + ecos.cycle 100%#198
bat1120 merged 1 commit into
devfrom
IM3-etl-refill-ttareungi-ecos

Conversation

@bat1120

@bat1120 bat1120 commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

audit-null-orphan-2026-05-04 발견 100% NULL 컬럼 중 가능 항목 재적재. settings.py 에 KAKAO/ECOS API key 추가 (.env 에 이미 있었으나 settings 미반영).

DB UPDATE (3,026 row)

테이블.컬럼 Before After 출처
master_ttareungi_station.dong_code (마포) 0/243 243/243 dong_centroid haversine 매핑
ecos_timeseries.cycle 0/2,783 (0%) 2,783/2,783 (100%) ECOS StatisticItemList API

settings.py 추가

kakao_api_key: str = os.getenv("KAKAO_API_KEY", "")
ecos_api_key: str = os.getenv("ECOS_API_KEY", "")

신규 스크립트 (재실행 가능)

파일 용도
scripts/ingest/fill_ttareungi_dong_code.py 마포 따릉이 dong_code 매핑
scripts/ingest/backfill_ecos_cycle.py ECOS API → cycle 채움 (페이지네이션)

미완 (불가)

항목 사유
kakao_store_hours.mon~sun_hours 카카오 비공식 endpoint (place.map.kakao.com/main/v/{kid}) deprecate (404/302). 별 API 권한 (Naver Place / 카카오 비즈) 필요
마포 외 따릉이 dong_code 5,298 row 서울 전체 dong_centroid 부재 (E4 한계). DongCentroid 서울 확장 별 PR

DB 변경

O — UPDATE 3,026 row. 스키마 변경 0. 다른 팀원 영향 0 (read 데이터 enrich).

Test plan

  • settings.kakao_api_key / ecos_api_key 로드 확인
  • master_ttareungi_station.dong_code 마포 243/243 ✓
  • ecos_timeseries.cycle 100% ✓
  • ruff check/format 통과
  • 스크립트 idempotent (재실행 시 NULL 만 update)

🤖 Generated with Claude Code

…settings 추가)

audit-null-orphan-2026-05-04 발견 100% NULL 컬럼 중 가능 항목 재적재.

settings.py:
- kakao_api_key + ecos_api_key 추가 (.env 에 이미 존재, settings 미반영이었음)

DB UPDATE (idempotent):
1. master_ttareungi_station.dong_code (마포 한정)
   - PR #184 가 채운 lat/lon 위에서 dong_centroid 16동 haversine 거리 매핑
   - 마포 sigungu_code='11440' 243 row 채움
   - 마포 외 5,298 row: 서울 전체 dong_centroid 부재 (E4 한계) — skip

2. ecos_timeseries.cycle: 0% → **100%** (2,783 row)
   - ECOS StatisticItemList API (3 stat_code: 121Y006/722Y001/901Y009)
   - 901Y009 페이지네이션 (1,743 items × 2 페이지) 처리
   - cycle 분포: Q 99.9%, A 0.1%

3. kakao_store_hours.mon~sun_hours: ❌ 불가
   - 카카오 비공식 endpoint (place.map.kakao.com/main/v/{kid}) deprecate
   - status 404/302 — 별 API (Naver Place / 카카오 비즈) 권한 필요

신규 스크립트 (재실행 가능):
- scripts/ingest/fill_ttareungi_dong_code.py
- scripts/ingest/backfill_ecos_cycle.py

DB 변경 요약:
- UPDATE: 243 (ttareungi) + 2,783 (ecos cycle) = 3,026 row
- 스키마 변경: 0
- 다른 팀원 영향: 0 (read 데이터 enrich만)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bat1120 bat1120 merged commit cd79bf3 into dev May 5, 2026
@bat1120 bat1120 deleted the IM3-etl-refill-ttareungi-ecos branch May 5, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant